package com.smart4soft.stock.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.smart4soft.stock.dao.AStorageDAO;
import com.smart4soft.stock.pojo.AStorage;
import com.smart4soft.stock.service.StorageService;
@Service ("storageService")
public class StorageServiceImpl implements StorageService {
	@Resource
	private AStorageDAO storageDAO;
	
	public List<AStorage> getAllList() {
		return storageDAO.findAll();
	}

	public void save(AStorage storage) {
		storageDAO.save(storage);
	}

	public AStorage find(long storageID) {
		return storageDAO.findById(storageID);
	}

	public void update(AStorage storage) {
		storageDAO.attachDirty(storage);
	}

	public void delete(long storageID) {
		storageDAO.delete(storageDAO.findById(storageID));
	}

}
